package com.tsh.erp.model;

import java.util.LinkedHashSet;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.FetchType;
import javax.persistence.OneToMany;
import javax.persistence.OrderBy;

import kiven.jee.model.StringIdTreeObject;

public class Department extends StringIdTreeObject<Department> {
	private static final long serialVersionUID = 1L;
	protected String code; //部门编码
	protected String telephone;//部门电话
	protected String fax;//部门传真
	protected String linkman;//部门联系人
	protected String desn;//描述，备注信息
	private Set<User> users = new LinkedHashSet<User>(); //有序的关联对象集合


	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public String getTelephone() {
		return telephone;
	}

	public void setTelephone(String telephone) {
		this.telephone = telephone;
	}

	public String getFax() {
		return fax;
	}

	public void setFax(String fax) {
		this.fax = fax;
	}

	public String getLinkman() {
		return linkman;
	}

	public void setLinkman(String linkman) {
		this.linkman = linkman;
	}

	public String getDesn() {
		return desn;
	}

	public void setDesn(String desn) {
		this.desn = desn;
	}

	/*
	@OneToMany(mappedBy="department",cascade ={CascadeType.ALL},fetch=FetchType.LAZY)
	@OrderBy("sortOrder asc")
	*/
	public Set<User> getUsers() {
		return users;
	}

	public void setUsers(Set<User> users) {
		this.users = users;
	}
	
}
